﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiFaceStyle : OdRxObject
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiFaceStyle(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGiFaceStyle_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiFaceStyle obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiFaceStyle()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiFaceStyle(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdGiFaceStyle cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiFaceStyle_cast(OdRxObject.getCPtr(pObj));
			OdGiFaceStyle result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiFaceStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiFaceStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiFaceStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiFaceStyle_desc(), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiFaceStyle_isA(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiFaceStyle_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static OdGiFaceStyle createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiFaceStyle_createObject();
			OdGiFaceStyle result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiFaceStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiFaceStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiFaceStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void set(OdGiFaceStyle style)
		{
			GlobalsPINVOKE.OdGiFaceStyle_set(this.swigCPtr, OdGiFaceStyle.getCPtr(style));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGiFaceStyle Assign(OdGiFaceStyle style)
		{
			OdGiFaceStyle result = (OdGiFaceStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiFaceStyle_Assign(this.swigCPtr, OdGiFaceStyle.getCPtr(style)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsEqual(OdGiFaceStyle style)
		{
			bool result = GlobalsPINVOKE.OdGiFaceStyle_IsEqual(this.swigCPtr, OdGiFaceStyle.getCPtr(style));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setLightingModel(OdGiFaceStyle.LightingModel lightingModel)
		{
			GlobalsPINVOKE.OdGiFaceStyle_setLightingModel(this.swigCPtr, (int)lightingModel);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGiFaceStyle.LightingModel lightingModel()
		{
			OdGiFaceStyle.LightingModel result = (OdGiFaceStyle.LightingModel)GlobalsPINVOKE.OdGiFaceStyle_lightingModel(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setLightingQuality(OdGiFaceStyle.LightingQuality lightingQuality)
		{
			GlobalsPINVOKE.OdGiFaceStyle_setLightingQuality(this.swigCPtr, (int)lightingQuality);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGiFaceStyle.LightingQuality lightingQuality()
		{
			OdGiFaceStyle.LightingQuality result = (OdGiFaceStyle.LightingQuality)GlobalsPINVOKE.OdGiFaceStyle_lightingQuality(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setFaceColorMode(OdGiFaceStyle.FaceColorMode mode)
		{
			GlobalsPINVOKE.OdGiFaceStyle_setFaceColorMode(this.swigCPtr, (int)mode);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGiFaceStyle.FaceColorMode faceColorMode()
		{
			OdGiFaceStyle.FaceColorMode result = (OdGiFaceStyle.FaceColorMode)GlobalsPINVOKE.OdGiFaceStyle_faceColorMode(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setFaceModifiers(uint nModifiers)
		{
			GlobalsPINVOKE.OdGiFaceStyle_setFaceModifiers(this.swigCPtr, nModifiers);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setFaceModifierFlag(OdGiFaceStyle.FaceModifier flag, bool bEnable)
		{
			GlobalsPINVOKE.OdGiFaceStyle_setFaceModifierFlag(this.swigCPtr, (int)flag, bEnable);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual uint faceModifiers()
		{
			uint result = GlobalsPINVOKE.OdGiFaceStyle_faceModifiers(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool isFaceModifierFlagSet(OdGiFaceStyle.FaceModifier flag)
		{
			bool result = GlobalsPINVOKE.OdGiFaceStyle_isFaceModifierFlagSet(this.swigCPtr, (int)flag);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setOpacityLevel(double nLevel, bool bEnableModifier)
		{
			GlobalsPINVOKE.OdGiFaceStyle_setOpacityLevel(this.swigCPtr, nLevel, bEnableModifier);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double opacityLevel()
		{
			double result = GlobalsPINVOKE.OdGiFaceStyle_opacityLevel(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setSpecularAmount(double nAmount, bool bEnableModifier)
		{
			GlobalsPINVOKE.OdGiFaceStyle_setSpecularAmount(this.swigCPtr, nAmount, bEnableModifier);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double specularAmount()
		{
			double result = GlobalsPINVOKE.OdGiFaceStyle_specularAmount(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setMonoColor(OdCmColorBase color, bool bEnableMode)
		{
			GlobalsPINVOKE.OdGiFaceStyle_setMonoColor(this.swigCPtr, OdCmColorBase.getCPtr(color), bEnableMode);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdCmColorBase monoColor()
		{
			OdCmColorBase result = new OdCmColorBase(GlobalsPINVOKE.OdGiFaceStyle_monoColor__SWIG_0(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		public enum LightingModel
		{
			kInvisible,
			kConstant,
			kPhong,
			kGooch
		}

		public enum LightingQuality
		{
			kNoLighting,
			kPerFaceLighting,
			kPerVertexLighting,
			kPerPixelLighting
		}

		public enum FaceColorMode
		{
			kNoColorMode,
			kObjectColor,
			kBackgroundColor,
			kMono,
			kTint,
			kDesaturate
		}

		public enum FaceModifier
		{
			kNoFaceModifiers,
			kOpacity,
			kSpecular
		}
	}
}
